package com.cms.setting.basicset.service.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.cms.setting.basicset.dao.EmailSettingDAO;
import com.cms.setting.basicset.pojo.EmailSetting;
import com.cms.setting.basicset.service.EmailSettingService;
@Service
public class EmailSettingServiceImpl implements EmailSettingService {
	@Autowired
	EmailSettingDAO emailSettingDAO;
	@Override
	public boolean saveEmailSetting(EmailSetting emailSetting) {
		if(emailSetting.getId()==null){
			return emailSettingDAO.insert(emailSetting)>0;
		}else{
			return emailSettingDAO.updateByPrimaryKey(emailSetting)>0;
		}
	}

	@Override
	public EmailSetting findById(Integer id) {
		return emailSettingDAO.selectByPrimaryKey(id);
	}

}
